xen/arm: p2m: Rework the context switch to another VTTBR in flush_tlb_domain
authorJulien Grall <julien.grall@arm.com>
Thu, 28 Jul 2016 14:20:16 +0000 (15:20 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 29 Jul 2016 00:42:40 +0000 (17:42 -0700)
commit69d8e2e0cfb987e6461818695d211d10841a7281
tree946126249e729c71ce019be525caeda728cc6bba
parentcfd7f424ebe40a5efa49efddd88859b0fb1d5abe
xen/arm: p2m: Rework the context switch to another VTTBR in flush_tlb_domain

The current implementation of flush_tlb_domain is relying on the domain
to have a single p2m. With the upcoming feature altp2m, a single domain
may have different p2m. So we would need to switch to the correct p2m in
order to flush the TLBs.

Rather than checking whether the domain is not the current domain, check
whether the VTTBR is different. The resulting assembly code is much
smaller: from 38 instructions (+ 2 functions call) to 22 instructions.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/p2m.c